@inherits Statiq.Razor.StatiqRazorPage<IEnumerable<IDocument>>

@foreach (IDocument item in Model)
{
  @if (!String.IsNullOrEmpty(item.GetString(WebKeys.Title)))
  {
    <div class="committee_container">
      <div class="committee_meta d-flex flex-column justify-content-center">
        @if (!string.IsNullOrWhiteSpace(item.GetString(SiteKeys.Repository)))
        {
          <h2><a href="@item.GetString(SiteKeys.Repository)#readme">@item.GetString(WebKeys.Title)</a></h2>
        }
        else
        {
          <h2>@item.GetString(WebKeys.Title)</h2>
        }
        <p class="latest_copy">@Html.Raw(item.GetString(WebKeys.Description))</p>
        @{
          var images = item.GetList<string>(SiteKeys.Images);
        }
        @if (!String.IsNullOrEmpty(item.GetString(SiteKeys.Chairperson)))
        {
          <div class="committee_img_container d-md-none text-center">
            @if (images != null)
            {
              foreach (var image in images)
              {
                <img src="@image" alt="Committee Members" />
              }
            }
            else if(!String.IsNullOrEmpty(item.GetString(SiteKeys.Image)))
            {
            <img src="@item.GetString(SiteKeys.Image)" alt="@item.GetString(WebKeys.Title)" />
            }
            else
            {
            <img src="img/dot_bot.png" alt="Default Dot Bot Image" />
            }
          </div>
          <p class="latest_copy">
            Chairperson(s): @item.GetString(SiteKeys.Chairperson)
          </p>
        }
        @if (!String.IsNullOrEmpty(item.GetString(SiteKeys.Meets)))
        {
          <p class="latest_copy">
            Meets: @item.GetString(SiteKeys.Meets)
          </p>
        }
        @if (!String.IsNullOrEmpty(item.GetString(SiteKeys.Repository)))
        {
          <p class="latest_copy">
            Repository: <a href="@item.GetString(SiteKeys.Repository)">@item.GetString(SiteKeys.Repository)</a>
          </p>
        }
      </div>
      <div class="committee_img_container align-items-center justify-content-center d-none d-md-flex">
        @if (images != null)
        {
          <div class="d-none d-md-flex flex-column">
          @foreach (var image in images)
          {
            <img src="@image" alt="Committee Members" class="rounded-image profile-image my-1" />
          }
          </div>
        }
        else if (!String.IsNullOrEmpty(item.GetString(SiteKeys.Image)))
        {
          <img src="@item.GetString(SiteKeys.Image)" alt="@item.GetString(WebKeys.Title)" class="rounded-image profile-image " />
        }
        else
        {
          <img src="img/dot_bot.png" alt="Default Dot Bot Image" class="rounded-image profile-image"  />
        }
      </div>
    </div>
    <hr/>
  }
}
